package com.tensquare.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tensquare.entity.Label;
import com.tensquare.service.ILabelService;

/**
 * <p>
 * 标签 前端控制器
 * </p>
 *
 * @author caoxingsheng
 * @since 2019-06-01
 */
@RestController
@RequestMapping("/label")
public class LabelController extends BaseController {
	@Autowired
	private ILabelService labelService;
	/**
	 * 查询
	 * @param id
	 * @return
	 */
	@GetMapping("/getById/{id}")
	public Label getById(@PathVariable("id") String id) {
		Label label = labelService.getById(id);
		return label;
	}
	@GetMapping("/test")
	public Object test() {
		int i = 1/0;
		return null;
	}
	@GetMapping("/test2")
	public Object test2() {
		if (true) {
			throw new RuntimeException("操作异常啊1");
		}
		return null;
	}
}
